'use strict';

/**
 * @ngdoc function
 * @name jgappApp.controller:TaskNewweeklyCtrl
 * @description
 * # TaskNewweeklyCtrl
 * Controller of the jgappApp
 */
angular.module('jgappApp')
    .controller('TaskNewweeklyCtrl', function(DataService, openApi, Util, $location) {
        this.submit = function() {
            if (!this.param.content1) {
                Util.Toast("请填写本周工作成效");
                return;
            }
            DataService.getData(openApi.addWeekly, this.param).then(function(data) {
                Util.goBack();
            }.bind(this));
        }
        DataService.getData(openApi.getWeeklyByStep).then(function(data) {
            if(data.content1){
                this.hasData=true;
                this.param=data
            }
        }.bind(this));
    });
